bgutils.py 670 B

12345678910111213141516171819
  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. print(fz_result['qty_fin'],fz_result['qty'])
  11. if fz_result['qty'] <= fz_result['qty_fin']:
  12. # 成立更新结案标识
  13. Zyupclose = ClassSqls.ZyUpClose.format(tz_no)
  14. IseUpDelQuery(Zyupclose)
  15. else:
  16. # 成立更新结案标识
  17. Zyupclose = ClassSqls.ZyUpNoClose.format(tz_no)
  18. IseUpDelQuery(Zyupclose)