bgutils.py 621 B

123456789101112131415161718
  1. from utils.executeQuery import executeQuery,IseUpDelQuery
  2. from utils.ClssSql import ClassSqls
  3. def uptz(tz_no):
  4. # 更新已生产量
  5. ZyUpFin = ClassSqls.ZyUpFin.format(tz_no)
  6. IseUpDelQuery(ZyUpFin)
  7. # 查询数据
  8. ZySelfz = ClassSqls.ZySelfz.format(tz_no)
  9. fz_result = executeQuery(ZySelfz)[0]
  10. if fz_result['qty'] <= fz_result['qty_fin']:
  11. # 成立更新结案标识
  12. Zyupclose = ClassSqls.ZyUpClose.format(tz_no)
  13. IseUpDelQuery(Zyupclose)
  14. else:
  15. # 成立更新结案标识
  16. Zyupclose = ClassSqls.ZyUpNoClose.format(tz_no)
  17. IseUpDelQuery(Zyupclose)